import {http} from "@/utils/http"
import {BannerItem, GuessItem} from "@/types/home.d.ts";
import {CategoryItem} from "@/types/home.d.ts";
import {HotItem} from "@/types/home.d.ts";
import {PageParams, PageResult} from "@/types/glocal.d.ts";

export const getHomeBannerAPI = (distributionSite: number = 1) => {
  return http<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite
    }
  })
}

export const getHomeCategoryAPI = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}

export const getHotItemAPI = () => {
  return http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}

/**
 * 猜你喜欢-小程序
 */
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
